﻿using System;
using System.Collections.Generic;
using System.Globalization;
using Medianamik.Core.Interfaces;


namespace Medianamik.Core.DAL
{

    public interface INodeDALProvider
    {
        IEnumerable<Node> GetNodes(IQueryDefinition pQueryDef);
        IEnumerable<Node> GetNodes(IQueryDefinition pQueryDef, bool withDeletedNodes);
        int GetNodeCount(IQueryDefinition pQueryDef);
       
        /// <summary>
        /// Indique combien d'enfants directs a un noeud
        /// </summary>
        /// <param name="pNodeInstanceID"></param>
        /// <returns></returns>
        Dictionary<Guid, int> ChildNodeCount(Guid[] pNodeIDs);

        void TransacSave(IEnumerable<NodeDataShell> nodeDataShells);

        void SetPosition(Guid pNodeId, int pPosition);

        void DeleteNodePropertyValues(Guid pNodeId, string pCultureName, DateTime? pRevision);

        void DeleteNodeInstance(Guid pNodeID, string pCultureName, bool pDestroy);
        void DeleteNode(Guid pNodeID, Guid pNodeTypeID, bool pDestroy);
        
        List<NodeProperty> GetNodePropertyValues(Node pNode, DateTime? pRevision);
        IEnumerable<NodeProperty> OldGetNodePropertyValues(Node pNode, int? pRevision);

        IEnumerable<IRelationOption> GetRelationOptions(OneToManyRelation pRelation, Guid? pRootNodeId);
        
        Publication CreatePublication(DateTime pStartDate, DateTime? pEndDate);

        string GetCurrentPath(Guid nodeId, Guid propertyId, string cultureName);

        List<Node> GetLegitimateParentNodes(Guid pTypeId);

        [Obsolete("There is no equivalent yet...")]
        DateTime[] GetNodeRevisions(Guid pNodeId, string pCultureName);

        [Obsolete("Use GetNewNodePublications instead")]
        IEnumerable<Publication> GetNodePublications(Guid pNodeId, string pCultureName);
        List<Publication> GetNewNodePublications(Guid nodeId, string cultureName);
    }
}
